﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Competition.Domain.Entity
{
    /// <summary>
    /// 平台账号表
    /// </summary>
    [Serializable, Table("m_platform_member")]
    public partial class PlatformMember : IAggregateRoot
    {
        /// <summary>
        /// 账号id
        /// </summary>
        [Key]
        [Column("id", TypeName = "int")]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [Required(ErrorMessage = "必填", AllowEmptyStrings = true)]
        [Display(Name = "id")]
        public int Id { get; set; }
        /// <summary>
        /// 用户名
        /// </summary>
        [Column("user_name", TypeName = "varchar(50)")]
        [Required(ErrorMessage = "必填", AllowEmptyStrings = true)]
        [StringLength(50, MinimumLength = 0, ErrorMessage = "{2}到{1}个字符")]
        [Display(Name = "用户名")]
        public string UserName { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [Column("password", TypeName = "varchar(50)")]
        [Required(ErrorMessage = "必填", AllowEmptyStrings = true)]
        [StringLength(50, MinimumLength = 0, ErrorMessage = "{2}到{1}个字符")]
        [Display(Name = "密码")]
        public string Password { get; set; }
        /// <summary>
        /// 昵称
        /// </summary>
        [Column("nickname", TypeName = "nvarchar(50)")]
        [StringLength(50, MinimumLength = 0, ErrorMessage = "{2}到{1}个字符")]
        [Display(Name = "昵称")]
        public string Nickname { get; set; }
        /// <summary>
        /// 添加时间
        /// </summary>
        [Column("addtime", TypeName = "datetime")]
        [Required(ErrorMessage = "必填", AllowEmptyStrings = true)]
        [Display(Name = "添加时间")]
        public DateTime AddTime { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        [Column("status", TypeName = "int")]
        [Required(ErrorMessage = "必填", AllowEmptyStrings = true)]
        [Display(Name = "状态")]
        public int Status { get; set; }
    }
}